using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Media.Media3D;
using System.Windows.Controls;

namespace Mud.Client.WPF.Graphics
{
    public abstract class Model
    {


        /// <summary>
        /// When the model is added to the scene then it has a 3D model.
        /// </summary>
        public ModelVisual3D ModelVisual3D
        {
            get { return _visualModel; }
            protected set { _visualModel = value; }
        }
        private ModelVisual3D _visualModel;

        /// <summary>
        /// Irrlich device.
        /// </summary>
        public Viewport3D Viewport3D
        {
            get { return _viewport3D; }
        }
        private Viewport3D _viewport3D;


        public Model(Viewport3D viewport3D)
        {
            if (viewport3D == null)
                throw new ArgumentNullException("viewport3D");
            _viewport3D = viewport3D;
        }


        public virtual void AddToScene()
        {
            _viewport3D.Children.Add(_visualModel);
        }

        public virtual void RemoveFromScene()
        {
            _viewport3D.Children.Remove(_visualModel);
        }

    }
}
